package com.lintesis.lintesismodel.users.Test;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

import com.lintesis.lintesismodel.users.Role;
import com.lintesis.lintesismodel.users.User;
import com.lintesis.lintesismodel.common.hibernate.ConnectionManager;
import com.lintesis.lintesismodel.common.hibernate.GenericDAO;
import com.lintesis.lintesismodel.common.hibernate.JasyptInitializer;

public class SysUserTest {
	public static void main(String args[]) throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
		JasyptInitializer.init();
		User sysUser=new User();
		sysUser.setLogin("admin2");
		sysUser.setName("Administrador2");
		sysUser.setSurname("Lima");
		sysUser.setPassword("admin2");
		
		Role role=new Role();
		role.setIdRol(1);
//		List<Role>roles=new GenericDAO<Role>().getByBussinessObject(role);
//		sysUser.setRols(roles);
		sysUser.save();
		ConnectionManager.commit();
	}
}
